<?php
/**
 * +-------------------------------------------------------------
 * |Caption:
 * +-------------------------------------------------------------
 * |Author: Lenny
 * +-------------------------------------------------------------
 * |Email:  1685964109@qq.com
 * +-------------------------------------------------------------
 * |Date:   2024/10/12 下午6:19
 * +-------------------------------------------------------------
 */

use think\facade\Route;

// 登录
Route::group('login', function ()
{
    Route::post('', 'Login/login');
    Route::get('out', 'Login/out');
    Route::get('send_sms', 'Login/sendSms');
});
// 门店
Route::group('store', function ()
{
    Route::get('list', 'salesman.Store/list');
    Route::get('detail', 'salesman.Store/detail');
    Route::post('sign_in', 'salesman.Store/signIn');
    Route::get('sign_log', 'salesman.Store/signLog');
    Route::post('add', 'salesman.Store/add');
Route::post('edit', 'salesman.Store/edit');
});
// 商品
Route::group('goods', function ()
{
    Route::get('cate_list', 'salesman.Goods/cateList');
    Route::get('list', 'salesman.Goods/list');
    Route::get('return_list', 'salesman.Goods/returnList');
    Route::get('detail', 'salesman.Goods/detail');
});
// 购物车
Route::group('cart', function ()
{
    Route::get('list', 'salesman.Cart/list');
    Route::post('add', 'salesman.Cart/add');
    Route::post('edit', 'salesman.Cart/edit');
    Route::post('del', 'salesman.Cart/del');
});
// 订单
Route::group('order', function ()
{
    Route::get('settle', 'salesman.Order/settle');
    Route::post('add', 'salesman.Order/add');
    Route::post('return_add', 'salesman.Order/returnAdd');
    Route::get('list', 'salesman.Order/list');
    Route::get('return_list', 'salesman.Order/returnList');
    Route::get('detail', 'salesman.Order/detail');
    Route::post('cancel', 'salesman.Order/cancel');
    Route::post('change_order', 'salesman.Order/changeOrder');
});
// 结算
Route::group('settle', function ()
{
    Route::get('store_list', 'salesman.Settle/storeList');
    Route::get('order_list', 'salesman.Settle/orderList');
    // 欠款收款
    Route::post('pay_owe', 'salesman.Settle/payOwe');
    // 预付款收款
    Route::post('pay_balance', 'salesman.Settle/payBalance');
    // 账期账单
    Route::get('payment_list', 'salesman.Settle/paymentList');
    // 账期账单结算
    Route::post('pay_zq', 'salesman.Settle/payPay');
});

// 业务仓库列表
Route::group('search', function (){
    Route::get('salesman_warehouse', 'salesman.Search/salesmanWarehouseList');
    Route::get('warehouse_goods','salesman.Search/warehouseGoodsList');
});

// 司机配送
Route::group('driver', function ()
{
    Route::get('store_list', 'driver.Task/storeList');
    Route::get('order_list', 'driver.Task/orderList');
    Route::get('order_info', 'driver.Task/orderInfo');
    Route::post('pay', 'driver.Task/pay');
    Route::post('upload', 'driver.Task/upload');
    Route::get('shop_list', 'driver.Store/list');
    Route::post('shop_edit', 'driver.Store/edit');
    Route::post('order_return', 'driver.Task/orderReturn');
    Route::post('create_return_order', 'driver.Task/addReturn');
    Route::get('return_order_list', 'driver.Task/returnOrderList');
    Route::get('return_order_detail', 'driver.Task/refundOrderDetail');
    Route::get('transfer_order_list', 'driver.Task/transferOrderList');
    Route::get('transfer_order_detail', 'driver.Task/transferOrderDetail');
    Route::get('warehouse_list', 'driver.Task/warehouseList');
});

// 经销商看板
Route::group('board', function ()
{
    Route::get('entrance', 'dealer.Board/entrance');
    // 经营报表
    Route::get('report', 'dealer.Board/report');
    // 账户余额
    Route::get('account', 'dealer.Board/account');
    Route::get('account_detail', 'dealer.Board/accountDetail');
});

// 仓库看板
Route::group('warehouse', function ()
{
    Route::get('entrance', 'dealer.Warehouse/entrance');
    Route::get('out_stock', 'dealer.Warehouse/outStock');
    Route::get('in_stock', 'dealer.Warehouse/inStock');
});

// 配送
Route::group('delivery', function ()
{
    Route::get('list', 'dealer.Delivery/list');
    Route::get('detail', 'dealer.Delivery/detail');
});

// 对账
Route::group('account', function ()
{
    Route::get('list', 'AccountRecord/list');
});

// 盘点
Route::group('stock', function ()
{
    Route::get('list', 'salesman.Stock/list');
    Route::get('detail', 'salesman.Stock/detail');
    Route::post('modify', 'salesman.Stock/modify');
    Route::post('check', 'salesman.Stock/check');
});

// J测试
Route::group('j', function ()
{
    Route::get('index', 'J/index');
});